package pers.vic.test.rpc.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import pers.vic.base.vo.BaseResponse;
import pers.vic.rpcbase.test.model.TestRpcOneVo;
import pers.vic.rpcbase.test.model.TestRpcTwoVo;
import pers.vic.rpcbase.test.service.TestRpcOneService;
import pers.vic.rpcbase.test.service.TestRpcTwoService;

//@RestController
@RequestMapping("/test/rpc")
public class RpcTestController {


	@Resource
	private TestRpcOneService testRpcOneService;
	
	@Resource
	private TestRpcTwoService rpcTwoService;
	
	@RequestMapping("/t1")
	public BaseResponse test1(@RequestParam(defaultValue="1")Integer id) {
		TestRpcOneVo v = testRpcOneService.getData(id);
		return BaseResponse.success(v);
	}
	
	@RequestMapping("/t2")
	public BaseResponse test2(@RequestParam(defaultValue="张三")String name) {
		TestRpcTwoVo v = rpcTwoService.findByName(name);
		return BaseResponse.success(v);
	}
}
